<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>我的私信</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <script src="/js/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link href="/css/likeHistory.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>

    <script>
        $(function () {
            var user = JSON.parse(sessionStorage.getItem("user"));
            var params = getParams();
           // console.log(params.id);
            var obj = {};
            $.get("/privateLetters/counts", {loginId: user.id}, function (data) {
                //判断长度(是否有聊天记录)
                console.log(data);
                if (data.list.length == 0) {
                    $(".aui-scrollView").html("<div class='aui-center'>\n" +
                        "            <span class='aui-center-title'>暂无联系人</span>\n" +
                        "        </div>");
                }

                $(".aui-scrollView").renderValues(data, {
                    getHref: function (item, value) {
                        $(item).attr("href", "/mine/messageLetterDetail.html?userId=" + value);
                    }
                });


                $(".aui-flex-logo").click(function () {
                    window.location.href = "/userProfiles.html?id=" + $(this).data("id");
                    return false;
                });
            });
        })

    </script>
</head>
<body>

<section class="aui-flexView">
    <header class="aui-navBar aui-navBar-fixed b-line">
        <a href="/mine/message.html" class="aui-navBar-item">
            <i class="icon icon-return"></i>
        </a>
        <div class="aui-center">
            <span class="aui-center-title">联系人列表</span>
        </div>
        <a href="javascript:history.go(-1);" class="aui-navBar-item">
        </a>
    </header>
    <section class="aui-scrollView">
        <div class="aui-list-box" render-loop="list">
            <a href="javascript:;" class="aui-flex" render-key="list.s_id" render-fun="getHref">
                <div class="aui-flex-logo" render-attr="data-id=list.s_id">
                    <img render-src="list.s_headImgUrl" alt="">
                </div>
                <div class="aui-flex-box">
                    <h2>
                        <span render-html="list.s_nickName"></span> <span class="getTotal"
                                                                               render-attr="data-sid=list.s_id"></span>
                    </h2>
                </div>
                <span class="aui-flex-add" render-html="list.sendTime"><!--render-fun="getTime"-->
                </span>
            </a>
        </div>
    </section>
</section>


</body>
</html>